package com.jerkin.service.decorator;

import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @version V1.0
 * @ClassName: DiscountCouponService
 * @Description:
 * @author: huhongzhi
 * @date: 2019/12/30 23:28
 */
@Component
public class DiscountCouponService extends AbsOrderPrice {

    private AbsOrderPrice absOrderPrice;

    public AbsOrderPrice getAbsOrderPrice() {
        return absOrderPrice;
    }

    public void setAbsOrderPrice(AbsOrderPrice absOrderPrice) {
        this.absOrderPrice = absOrderPrice;
    }

    @Override
    public BigDecimal calculate() {
        return absOrderPrice.calculate().subtract(BigDecimal.valueOf(10));
    }
}
